﻿<?php

require_once $_SERVER['rootadmin']."/classes/ConnectToBD_cmix.class.php";
	//require_once "./classes/ConnectToBD_tc.class.php";
	
	$idcon_cmix=ConnectToBd_cmix::connexion();
	
	//On recupere la liste des variables de configuration pour la plateforme (plateforme = serveur de jeu avec id 0)
	$req="SELECT * FROM configuration WHERE id_jeu='".$_GET['jeu']."';";
	$variables=$idcon_cmix->prepare($req);
	$variables->execute();

?>
<table class="stats">
		<tr>
			<th colspan="4">Variables de configuration</th>
		</tr>
		<?php
			// On affiche toutes les variables
			while($variable=$variables->fetch()){
		?>
		<tr id="<?php echo $variable['nom'];?>">
			<td><span class="variable_nom"><?php echo $variable['nom']; ?></span></td>
			<td><input class="variable_valeur" type="text" value="<?php echo $variable['valeur'];?>"/></td>
			<td><?php echo $variable['description'];?></td>
			<td><input type="button" onClick="deleteVar('<?php echo $variable['nom']; ?>');" value="Supprimer" /></td>
		</tr>
		<tr><th colspan="5"></th></tr><?php
		}
		?>
		<tr id="new_var">
			<td colspan="5"><input type="button" onClick="showNewVar('<?php echo $_GET['jeu'];?>');" value="Ajouter une variable"/></td>
		</tr>
		<tr>
		<th></th>
			<th>
				<input type="button" onClick="setVars();" value="Valider"/>
			</th>
			<th colspan="2">
				<input type="button" onClick="getVars('<?php echo $_GET['jeu'];?>');" value="Reset"/>
			</th>
		</tr>
	</table>